const { Article } = require('../../model/article.js');

module.exports = async (req, res) => {
	const id = req.query.id;
	//根据id从数据库中查询并删除此条数据
	await Article.findOneAndDelete({_id: id});
	//重定向到用户列表
	res.redirect('/admin/article');
}